package com.windoent.yugioh.adapter.brvah;

import android.view.View;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.windoent.yugioh.R;
import com.windoent.yugioh.bean.JoinPlayerData;
import com.windoent.yugioh.utils.BaseMethod;
import com.windoent.yugioh.utils.SimpleUtils;
import com.windoent.yugioh.widget.RoundImageView;

/**
 * author : robert
 * date   : 2021/5/6 15:26
 * desc   :
 */
public class ConTestationListAdapter extends BaseQuickAdapter<JoinPlayerData.DataBean.PlayerBean, BaseViewHolder> {

    public ConTestationListAdapter() {
        super(R.layout.item_contsetant_list, null);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, JoinPlayerData.DataBean.PlayerBean item) {
        helper.setText(R.id.tv_name, BaseMethod.notNullDefaultValueNull(item.getNickname()))
                .setText(R.id.tv_id, getContext().getString(R.string.string_user_info_id) + BaseMethod.notNullDefaultValueNull(item.getViewId() + ""));
        RoundImageView image = helper.getView(R.id.image);
        SimpleUtils.loadImageForView(getContext(), image, item.getAvatar(), R.drawable.img_official_avatar_android);
    }
}